﻿using Newtonsoft.Json.Linq;
using NHotkey;
using NHotkey.WindowsForms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Tool.Helper
{
    public class HotKeyHelper
    {
        /// <summary>
        /// 添加热键
        /// </summary>
        /// <param name="name">热键名称</param>
        /// <param name="keys">注册热键的键组合如 Keys.Control | Keys.Alt | Keys.Add</param>
        /// <param name="handler">按下热键时执行的方法</param>
        public static void AddHotKey(string name, Keys keys, EventHandler<HotkeyEventArgs> handler)
        {
            HotkeyManager.Current.AddOrReplace(name, keys, handler);
        }
        private void OnIncrement(object sender, HotkeyEventArgs e)
        {
            e.Handled = true;
        }
    }
}
